﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace CKS2412.Controller
{
    public class SignalAdrSetting
    {
        public static int dbTotal { get; set; } = 3001;
        /// <summary>
        /// OP10 DB块
        /// </summary>
        public static int dbOp10 { get; set; } = 3011;
        /// <summary>
        /// OP20 DB块
        /// </summary>
        public static int dbOp20 { get; set; } = 3021;
        /// <summary>
        /// OP30 DB块
        /// </summary>
        public static int dbOp30 { get; set; } = 3031;
        public static int dbTotal_FromPc { get; set; } = 3000;
        /// <summary>
        /// OP10 FromPC DB块
        /// </summary>
        public static int dbOp10_FromPc { get; set; } = 3010;
        /// <summary>
        /// OP20 FromPC DB块
        /// </summary>
        public static int dbOp20_FromPc { get; set; } = 3020;
        /// <summary>
        /// OP30 FromPC DB块
        /// </summary>
        public static int dbOp30_FromPc { get; set; } = 3030;


        #region 总线
        /// <summary>
        /// 运行状态
        /// </summary>
        public static string DeviceState { get; set; } = "0";
        /// <summary>
        /// 设备模式
        /// </summary>
        public static string DeviceMode { get; set; } = "2";
        /// <summary>
        /// 生产模式
        /// </summary>
        public static string WorkMode { get; set; } = "8";
        /// <summary>
        /// 心跳
        /// </summary>
        public static string WatchDog { get; set; } = "0";
        /// <summary>
        /// 心跳_PLC
        /// </summary>
        public static string WatchDogToPC { get; set; } = "6";

        #endregion

        #region OP10
        #region ToPC
        /// <summary>
        /// OP10存储数据开始上传
        /// </summary>
        public static string UploadStart_OP10 { get; set; } = "2";
        /// <summary>
        /// OP10 A件产品状态
        /// </summary>
        public static string ProductStatusA_OP10 { get; set; } = "4";
        /// <summary>
        /// OP10 B件产品状态
        /// </summary>
        public static string ProductStatusB_OP10 { get; set; } = "6";
        /// <summary>
        /// A件判定结果 OP10
        /// </summary>
        public static string ResultA_OP10 { get; set; } = "8";
        /// <summary>
        /// B件判定结果 OP10
        /// </summary>
        public static string ResultB_OP10 { get; set; } = "10";
        /// <summary>
        /// 主条码A OP10
        /// </summary>
        public static string SerialNumberA_OP10 { get; set; } = "200.48";
        /// <summary>
        /// 主条码B OP10
        /// </summary>
        public static string SerialNumberB_OP10 { get; set; } = "250.48";
        /// <summary>
        /// OP10A批量数据读取的起始位
        /// </summary>
        public static int dataStartOffsetA_OP10 { get; set; } = 1000;
        /// <summary>
        /// OP10B批量数据读取的起始位
        /// </summary>
        public static int dataStartOffsetB_OP10 { get; set; } = 1500;

        #endregion
        #region FromPC
        /// <summary>
        /// 存储数据上传完成OP10 A
        /// </summary>
        public static string UploadDoneA_OP10 { get; set; } = "2002";
        /// <summary>
        /// 存储数据上传完成OP10 B
        /// </summary>
        public static string UploadDoneB_OP10 { get; set; } = "2100";
        ///// <summary>
        ///// 存储数据上传完成OP10B
        ///// </summary>
        //public static string UploadDoneB_OP10 { get; set; } = "";
        /// <summary>
        /// 允许OP10工作
        /// </summary>
        public static string AllowWork_OP10 { get; set; } = "";
        #endregion
        #endregion

        #region OP20
        #region ToPC
        /// <summary>
        /// OP20存储数据开始上传
        /// </summary>
        public static string UploadStart_OP20 { get; set; } = "2";
        ///// <summary>
        ///// OP20上传代号 0:初始，10：通道A，11：通道B，12：全部
        ///// </summary>
        //public static string UploadCode_OP20 { get; set; } = "14";
        /// <summary>
        /// A件产品状态
        /// </summary>
        public static string ProductStatusA_OP20 { get; set; } = "4";
        /// <summary>
        /// B件产品状态
        /// </summary>
        public static string ProductStatusB_OP20 { get; set; } = "50";
        /// <summary>
        /// 耐压A判定结果DC
        /// </summary>
        public static string WithstandVoltageDcResultA { get; set; } = "8";
        /// <summary>
        /// 耐压B判定结果DC
        /// </summary>
        public static string WithstandVoltageDcResultB { get; set; } = "54";
        /// <summary>
        /// 耐压A判定结果AC
        /// </summary>
        public static string WithstandVoltageAcResultA { get; set; } = "6";
        /// <summary>
        /// 耐压B判定结果AC
        /// </summary>
        public static string WithstandVoltageAcResultB { get; set; } = "52";
        /// <summary>
        /// 相机拍照A结果-残留
        /// </summary>
        public static string CcdResult_VestigitalA { get; set; } = "10";
        /// <summary>
        /// 相机拍照B结果-残留
        /// </summary>
        public static string CcdResult_VestigitalB { get; set; } = "56";
        /// <summary>
        /// 相机拍照A结果-方向
        /// </summary>
        public static string CcdResult_DirectionA { get; set; } = "12";
        /// <summary>
        /// 相机拍照B结果-方向
        /// </summary>
        public static string CcdResult_DirectionB { get; set; } = "58";
        public static string TotalLengthA_OP20 { get; set; } = "16";
        public static string TotalLengthB_OP20 { get; set; } = "62";
        /// <summary>
        /// 产品A总结果
        /// </summary>
        public static string FinalResultA_OP20 { get; set; } = "14";
        /// <summary>
        /// 产品B总结果
        /// </summary>
        public static string FinalResultB_OP20 { get; set; } = "60";
        /// <summary>
        /// OP20A批量数据读取的起始位
        /// </summary>
        public static int dataStartOffsetA_OP20 { get; set; } = 1000;
        /// <summary>
        /// OP20B批量数据读取的起始位
        /// </summary>
        public static int dataStartOffsetB_OP20 { get; set; } = 1100;
        /// <summary>
        /// 主条码A OP20
        /// </summary>
        public static string SerialNumberA_OP20 { get; set; } = "200.48";
        /// <summary>
        /// 主条码B OP20
        /// </summary>
        public static string SerialNumberB_OP20 { get; set; } = "250.48";

        #endregion
        #region FromPc
        /// <summary>
        /// 存储数据上传完成OP20 A
        /// </summary>
        public static string UploadDoneA_OP20 { get; set; } = "2002";
        /// <summary>
        /// 存储数据上传完成OP20 B
        /// </summary>
        public static string UploadDoneB_OP20 { get; set; } = "2100";
        ///// <summary>
        ///// 存储数据上传完成OP20B
        ///// </summary>
        //public static string UploadDoneB_OP20 { get; set; } = "";
        ///// <summary>
        ///// 允许OP20工作
        ///// </summary>
        //public static string AllowWork_OP20 { get; set; } = "";
        #endregion
        #endregion

        #region OP30
        #region ToPC
        /// <summary>
        /// OP30A存储数据开始上传
        /// </summary>
        public static string UploadStart_OP30 { get; set; } = "2";
        ///// <summary>
        ///// OP30B存储数据开始上传
        ///// </summary>
        //public static string UploadCode_OP30 { get; set; } = "14";
        /// <summary>
        /// A件产品状态
        /// </summary>
        public static string ProductStatusA_OP30 { get; set; } = "4";
        /// <summary>
        /// B件产品状态
        /// </summary>
        public static string ProductStatusB_OP30 { get; set; } = "6";
        ///// <summary>
        ///// 3D启动A通道（0：初始，1：启动，2：停止）
        ///// </summary>
        //public static string LineLaserStartA { get; set; } = "16";
        ///// <summary>
        ///// 3D启动B通道（0：初始，1：启动，2：停止）
        ///// </summary>
        //public static string LineLaserStartB { get; set; } = "18";

        /// <summary>
        /// 3D和膜厚启动
        /// </summary>
        public static string HardwareStart { get; set; } = "18";

        /// <summary>
        /// 膜厚启动（0：初始，1：启动，2：停止）
        /// </summary>
        public static string ThicknessStart { get; set; } = "20";
        ///// <summary>
        ///// 膜厚启动B（0：初始，1：启动，2：停止）
        ///// </summary>
        //public static string ThicknessStartB { get; set; } = "22";
        /// <summary>
        /// A件产品最终结果
        /// </summary>
        public static string FinalResultA_OP30 { get; set; } = "8";
        /// <summary>
        /// B件产品最终结果
        /// </summary>
        public static string FinalResultB_OP30 { get; set; } = "12";
        /// <summary>
        /// 立面拱曲度A判定结果
        /// </summary>
        public static string CamberResultA { get; set; } = "10";
        /// <summary>
        /// 立面拱曲度B判定结果
        /// </summary>
        public static string CamberResultB { get; set; } = "14";
        /// <summary>
        /// 通道ID 1=A1B1  2=A2B2
        /// </summary>
        public static string ChannelCode_OP30 { get; set; } = "16";
        /// <summary>
        /// 主条码A OP30
        /// </summary>
        public static string SerialNumberA_OP30 { get; set; } = "200.48";
        /// <summary>
        /// 主条码B OP30
        /// </summary>
        public static string SerialNumberB_OP30 { get; set; } = "250.48";

        /// <summary>
        /// OP30A批量数据读取的起始位
        /// </summary>
        public static int dataStartOffsetA_OP30 { get; set; } = 1000;
        /// <summary>
        /// OP30B批量数据读取的起始位
        /// </summary>
        public static int dataStartOffsetB_OP30 { get; set; } = 1004;
        #endregion
        #region FromPC
        /// <summary>
        /// 膜厚控制反馈 1-正常反馈 2-不正常反馈 0-不管
        /// </summary>
        public static string MhControlFeedback { get; set; } = "4";
        /// <summary>
        /// 存储数据上传完成OP30 A
        /// </summary>
        /// 
        public static string UploadDoneA_OP30 { get; set; } = "2002";
        /// <summary>
        /// 存储数据上传完成OP30 B
        /// </summary>
        /// 
        public static string UploadDoneB_OP30 { get; set; } = "2168";
        /// <summary>
        /// 启动状态回馈 1-收到请求  0-无请求
        /// </summary>
        public static string StartAck { get; set; } = "2022";
        ///// <summary>
        ///// 存储数据上传完成OP30B
        ///// </summary>
        //public static string UploadDoneB_OP30 { get; set; } = "";
        ///// <summary>
        ///// 允许OP30工作
        ///// </summary>
        //public static string AllowWork_OP30 { get; set; } = "";
        ///// <summary>
        ///// 3D工作状态A
        ///// </summary>
        //public static string LineLaserWorkA { get; set; } = "2006";
        ///// <summary>
        ///// 3D工作状态B
        ///// </summary>
        //public static string LineLaserWorkB { get; set; } = "2010";
        /// <summary>
        /// 3D结果A
        /// </summary>
        public static string LineLaserResultA { get; set; } = "2006";
        /// <summary>
        /// 3D结果B
        /// </summary>
        public static string LineLaserResultB { get; set; } = "2010";
        /// <summary>
        /// 膜厚控制器Ready
        /// </summary>
        public static string ThicknessReady { get; set; } = "500";
        /// <summary>
        /// 线扫控制器1Ready
        /// </summary>
        public static string LineLaserDev1Ready { get; set; } = "502";
        /// <summary>
        /// 线扫控制器2Ready
        /// </summary>
        public static string LineLaserDev2Ready { get; set; } = "504";
        /// <summary>
        /// 线扫控制器3Ready
        /// </summary>
        public static string LineLaserDev3Ready { get; set; } = "506";
        /// <summary>
        /// 线扫控制器4Ready
        /// </summary>
        public static string LineLaserDev4Ready { get; set; } = "508";
        ///// <summary>
        ///// 膜厚A工作
        ///// </summary>
        //public static string ThicknessWorkA { get; set; } = "20";
        ///// <summary>
        ///// 膜厚B工作
        ///// </summary>
        //public static string ThicknessWorkB { get; set; } = "22";
        /// <summary>
        /// 膜厚A判定结果
        /// </summary>
        public static string ThicknessResultA { get; set; } = "2004";
        /// <summary>
        /// 膜厚B判定结果
        /// </summary>
        public static string ThicknessResultB { get; set; } = "2008";
        #endregion
        #endregion
    }
}
